package com.szr.cloud.springboot_hello.quartz;

import java.text.SimpleDateFormat;
import java.util.Date;

import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
@EnableScheduling
public class CronJob {

	private SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
	
	
	@Scheduled(cron="0/10 * * * * ?")
	public void simpJob(){
		System.out.println("定时任务：" + simpleDateFormat.format(new Date()));
	}
}
